home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 August: Technology Seed / ADC Seed CD - August 1999.toast / Carbon SDK 1.0d10c3 / Sample Code / SimpleText / AGFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-04  |  4.8 KB  |  180 lines  |  [TEXT/CWIE]

  1. /***************************************************************************************
  2.  
  3.     File:        AGFile.h
  4.  
  5.     Contains:    Public interface to Apple Guide Database Files.
  6.                 Does not use or require the Apple Guide extension.
  7.  
  8.     Version:    GX 1.2 or later
  9.  
  10.     Written by:    John R. Powers, III
  11.  
  12.     Copyright:    ©1994, 1996 by Apple Computer, Inc. All rights reserved.
  13.  
  14.     File Ownership:
  15.  
  16.         DRI:                Tom Dowdy
  17.  
  18.         Other Contact:        Jim Negrette
  19.  
  20.         Technology:            Macintosh Graphics Group
  21.  
  22.     Writers:
  23.  
  24.         (ted)    Tom Dowdy
  25.  
  26.     Change History (most recent first):
  27.  
  28.     $Log: AGFile.h,v $
  29.     Revision 1.2  1998/03/19 03:55:24  mkellner
  30.     - Add <ConditionalMacros.h> and <QTMLMapNames.h>
  31.     - Fix captialization of math.h, stdio.h, strings.h, etc.
  32.     - Change Types.h, Memory.h and Windows.h to MacTypes, MacMemory, and MacWindows
  33.     - Add inital set of stubs.
  34.     - Change Types.r to MacTypes.r
  35.  
  36.     Revision 1.1.1.1  1998/03/18 22:56:00  ivory
  37.     Initial checkin of SimpleText.
  38.     
  39.         
  40.         1     7/28/97 11:11 AM Duane Byram
  41.         first added to Source Safe project
  42.  
  43.          <2>      2/8/96    ted        Fixing invalid #endif comments
  44.          <1>     8/21/95    TD        First checked in.
  45.     <2>        23-Mar-94 JRP    Add:
  46.                                 AGFileGetHelpMenuAppCreator
  47.                                 AGFileGetMixinMatchSelector
  48.                                 AGFileGetHelpMenuBalloonText
  49.     <1>        24-Jan-94 JRP    Initial check-in
  50.  
  51. ***************************************************************************************/
  52.  
  53. #ifndef __AGFILE__
  54. #define __AGFILE__
  55.  
  56. #ifndef __FILES__
  57.     #include <Files.h>
  58. #endif
  59.  
  60. #ifndef __TYPES__
  61.     #include <MacTypes.h>
  62. #endif
  63.  
  64.             // typedef's
  65.  
  66. typedef FSSpec AGFileFSSpecType;
  67. typedef short AGFileSelectorCountType;
  68. typedef short AGFileSelectorIndexType;
  69. typedef OSType AGFileSelectorType;
  70. typedef long AGFileSelectorValueType;
  71. typedef short AGFileDBType;
  72. typedef ConstStr63Param AGFileDBMenuNamePtr;
  73. typedef short AGFileDBScriptType;
  74. typedef short AGFileDBRegionType;
  75. typedef short AGFileMajorRevType;
  76. typedef short AGFileMinorRevType;
  77. typedef short AGFileCountType;
  78.  
  79.             // Database types (for AGFileDBType parameter).
  80.  
  81. enum
  82. {
  83.     kAGFileDBTypeAny =            0,
  84.     kAGFileDBTypeHelp =            1,
  85.     kAGFileDBTypeTutorial =        2,
  86.     kAGFileDBTypeShortcuts =    3,
  87.     kAGFileDBTypeAbout =        4,
  88.     kAGFileDBTypeOther =        8
  89. };
  90.  
  91.             // Functions.
  92.  
  93.         // Get the database menu item name.
  94. pascal OSErr
  95. AGFileGetDBMenuName(AGFileFSSpecType *fileSpec,
  96.                     AGFileDBMenuNamePtr menuItemNameString);
  97.  
  98.         // Get the database type.
  99. pascal OSErr
  100. AGFileGetDBType(AGFileFSSpecType *fileSpec,
  101.                 AGFileDBType *databaseType);
  102.  
  103.         // Get the version of the software
  104.         // that created this database.
  105. pascal OSErr
  106. AGFileGetDBVersion(AGFileFSSpecType *fileSpec,
  107.                     AGFileMajorRevType *majorRev,
  108.                     AGFileMinorRevType *minorRev);
  109.  
  110.         // Get the database script and region information.
  111. pascal OSErr
  112. AGFileGetDBCountry(AGFileFSSpecType *fileSpec,
  113.                     AGFileDBScriptType *script,
  114.                     AGFileDBRegionType *region);
  115.  
  116.         // Return the number of selectors in database.
  117. pascal AGFileSelectorCountType
  118. AGFileGetSelectorCount(AGFileFSSpecType *fileSpec);
  119.  
  120.         // Get the i-th database selector (1 to AGFileSelectorCountType)
  121.         // and its value.
  122. pascal OSErr
  123. AGFileGetSelector(AGFileFSSpecType *fileSpec,
  124.                     AGFileSelectorIndexType selectorNumber,
  125.                     AGFileSelectorType *selector,
  126.                     AGFileSelectorValueType *value);
  127.  
  128.         // Return true if database is mixin.
  129. pascal Boolean
  130. AGFileIsMixin(AGFileFSSpecType *fileSpec);
  131.  
  132.         // Return the number of database files
  133.         // of the specified databaseType and main/mixin.
  134.         // Any file creator is acceptible,
  135.         // but type must be kAGFileMain or kAGFileMixin.
  136. pascal AGFileCountType
  137. AGFileGetDBCount(short vRefNum,
  138.                     long dirID,
  139.                     AGFileDBType databaseType,
  140.                     Boolean wantMixin);
  141.  
  142.         // Get the FSSpec for the dbIndex-th database
  143.         // of the specified databaseType and main/mixin.
  144.         // Any file creator is acceptible,
  145.         // but type must be kAGFileMain or kAGFileMixin.
  146. pascal OSErr
  147. AGFileGetIndDB(short vRefNum,
  148.                 long dirID,
  149.                 AGFileDBType databaseType,
  150.                 Boolean wantMixin,
  151.                 short dbIndex,
  152.                 FSSpec *fileSpec);
  153.  
  154.         // This selector must match with the application
  155.         // creator in order for this file to appear in the 
  156.         // application's Help menu. Ignored for mixin files
  157.         // because they never appear in the Help menu anyway.
  158.         // If empty (zeros), will appear in the Help menu
  159.         // of any host application.
  160. pascal OSErr
  161. AGFileGetHelpMenuAppCreator(AGFileFSSpecType *fileSpec,
  162.                                 OSType *helpMenuAppCreator);
  163.  
  164.         // This selector must match in the main and mixin
  165.         // files in order for the mixin to mix-in with the main.
  166.         // Empty (zeros) selectors are valid matches.
  167.         // A '****' selector will mix-in with any main.
  168. pascal OSErr
  169. AGFileGetMixinMatchSelector(AGFileFSSpecType *fileSpec,
  170.                                 OSType *mixinMatchSelector);
  171.  
  172.         // This is the text of the balloon for the
  173.         // Help menu item for this database.
  174. pascal OSErr
  175. AGFileGetHelpMenuBalloonText(AGFileFSSpecType *fileSpec,
  176.                                 Str255 helpMenuBalloonString);
  177.  
  178. #endif /* __AGFILE__ */
  179.  
  180.